Skip to content
This repository has been archived by the owner on Sep 21, 2021. It is now read-only.

WIP Get the pending policies from http #668

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from
Open

Conversation

rafaelje
Copy link
Contributor

Changes description

{
    "id": 909,
    "itemtype_applied": "PluginFlyvemdmFleet",
    "items_id_applied": 262,
    "plugin_flyvemdm_policies_id": 13,
    "value": 0,
    "itemtype": "",
    "items_id": 0,
    "links": [
        {
            "rel": "UNKNOWN",
            "href": "https://dev.flyve.org/glpi/apirest.php/UNKNOWN/262"
        },
        {
            "rel": "PluginFlyvemdmPolicy",
            "href": "https://dev.flyve.org/glpi/apirest.php/PluginFlyvemdmPolicy/13"
        }
    ]
}
  • step 2: get items_id_applied from the object and replace the {FleetID} on this url:

https://dev.flyve.org/glpi/apirest.php/search/PluginFlyvemdmTask/?criteria[0][link]=and&criteria[0][field]=9&criteria[0][searchtype]=equals&criteria[0][value]=PluginFlyvemdmFleet&criteria[1][link]=and&criteria[1][field]=10&criteria[1][searchtype]=equals&criteria[1][value]={FleetID}&uid_cols=true&forcedisplay[0]=1&forcedisplay[1]=2&forcedisplay[2]=3&forcedisplay[3]=5&forcedisplay[4]=6&forcedisplay[5]=7&range=0-7&

{
    "totalcount": 3,
    "count": 3,
    "sort": 1,
    "order": "ASC",
    "data": [
        {
            "PluginFlyvemdmTask.id": 907,
            "PluginFlyvemdmTask.value": "{\"remove_on_delete\":\"1\"}",
            "PluginFlyvemdmTask.PluginFlyvemdmPolicy.id": 14,
            "PluginFlyvemdmTask.itemtype": "PluginFlyvemdmPackage",
            "PluginFlyvemdmTask.items_id": 51,
            "PluginFlyvemdmTask.itemtype_applied": "PluginFlyvemdmFleet",
            "PluginFlyvemdmTask.items_id_applied": 262
        },
        {
            "PluginFlyvemdmTask.id": 908,
            "PluginFlyvemdmTask.value": 0,
            "PluginFlyvemdmTask.PluginFlyvemdmPolicy.id": 20,
            "PluginFlyvemdmTask.itemtype": "",
            "PluginFlyvemdmTask.items_id": 0,
            "PluginFlyvemdmTask.itemtype_applied": "PluginFlyvemdmFleet",
            "PluginFlyvemdmTask.items_id_applied": 262
        },
        {
            "PluginFlyvemdmTask.id": 909,
            "PluginFlyvemdmTask.value": 0,
            "PluginFlyvemdmTask.PluginFlyvemdmPolicy.id": 13,
            "PluginFlyvemdmTask.itemtype": "",
            "PluginFlyvemdmTask.items_id": 0,
            "PluginFlyvemdmTask.itemtype_applied": "PluginFlyvemdmFleet",
            "PluginFlyvemdmTask.items_id_applied": 262
        }
    ],
    "content-range": "0-2/3"
}

step 3 find the policy and get the symbol value

https://dev.flyve.org/glpi/apirest.php/PluginFlyvemdmPolicy/{ID}

{
    "id": 13,
    "name": "Disable Camera",
    "group": "camera",
    "symbol": "disableCamera",
    "type": "bool",
    "type_data": "\"\"",
    "unicity": 1,
    "plugin_flyvemdm_policycategories_id": 5,
    "comment": "Prevent usage of the Camera",
    "default_value": 0,
    "recommended_value": 0,
    "is_android_system": 0,
    "android_min_version": 4,
    "android_max_version": 0,
    "apple_min_version": 0,
    "apple_max_version": 0,
    "links": [
        {
            "rel": "PluginFlyvemdmPolicyCategory",
            "href": "https://dev.flyve.org/glpi/apirest.php/PluginFlyvemdmPolicyCategory/5"
        }
    ]
}

Checklist

Please check if your PR fulfills the following specifications:

  • Tests for the changes have been added
  • Docs have been added/updated

Estimated time

Assignee 🍅
@rafaelje 1

References

Closes #N/A
Related #N/A
Depends on #N/A

@rafaelje rafaelje added this to the 2.0 milestone Dec 26, 2018
@rafaelje rafaelje self-assigned this Dec 26, 2018
@rafaelje rafaelje requested a review from ajsb85 December 26, 2018 14:57
@rafaelje rafaelje changed the title Get the pending policies from http WIP Get the pending policies from http Dec 26, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant